<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>函数和作用域-第一步</title>
</head>
<body>
  <script type="text/javascript">
    function Foo () {
        getName = function () {
            console.log(1);
        };
        return this;
    }
    Foo.getName = function () {
        console.log(2);
    };
    Foo.prototype.getName = function () {
        console.log(3);
    };
    var getName = function () {
        console.log(4);
    };

    function getName () {
        console.log(5);
    }

    Foo.getName(); // 2
    getName(); // 4
  </script>













  <!--变量提升文章：https://segmentfault.com/a/1190000008568071  -->
</body>

</html>
